type MyCircularDeque struct {
    List []int
    Len int
    Max int
}


func Constructor(k int) MyCircularDeque {
    return MyCircularDeque{[]int{},0,k}
}


func (this *MyCircularDeque) InsertFront(value int) bool {
    if this.IsFull(){
        return false
    }
    tmp := []int{value}
    this.List = append(tmp,this.List...)
    this.Len += 1
    return true
}


func (this *MyCircularDeque) InsertLast(value int) bool {
    if this.IsFull(){
        return false
    }
    this.List = append(this.List,value)
    this.Len += 1
    return true
}


func (this *MyCircularDeque) DeleteFront() bool {
    if this.IsEmpty(){
        return false
    }
    this.List = this.List[1:]
    this.Len -= 1
    return true
}


func (this *MyCircularDeque) DeleteLast() bool {
    if this.IsEmpty(){
        return false
    }
    this.List = this.List[0:this.Len-1]
    this.Len -= 1
    return true
}


func (this *MyCircularDeque) GetFront() int {
    if this.IsEmpty() {
        return -1
    }
    return this.List[0]
}


func (this *MyCircularDeque) GetRear() int {
    if this.IsEmpty(){
        return -1
    }
    return this.List[this.Len-1]
}


func (this *MyCircularDeque) IsEmpty() bool {
    return this.Len == 0
}


func (this *MyCircularDeque) IsFull() bool {
    return this.Len == this.Max
}

